/** \file gu_shader_variable.h */
#pragma once

#include "gr_algorithms.h"

#include<map>

namespace gu
{

/** Encode input/output mapping.*/
enum TypeMapping
{
    IN                 ,
    OUT                ,
    UNIFORM 
};

/** Encode variable type.*/
enum VariableType
{
    SCALAR = 0,
    VEC3   = 1, 
    VEC4   = 2,
    MAT4   = 3,
    TEXTURE2D = 4
};

struct Variable
{
    TypeMapping  mapping;
    VariableType type;
    std::string  name;
    bool is(const TypeMapping& m) const{return mapping == m;}
    bool is(const VariableType& t) const{return type == t;}
};

typedef std::map<std::string, Variable> VariableMap;

Variable makeVariable(TypeMapping& map, VariableType& type, std::string name);
Variable makeVariable(TypeMapping& map, VariableType& type, const char* name);


}
